package org.ResearchProject.service.serviceImpl;

import org.ResearchProject.mapper.TutorMapper;
import org.ResearchProject.pojo.Student;
import org.ResearchProject.pojo.Tutor;
import org.ResearchProject.pojo.User;
import org.ResearchProject.service.TutorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * 2024-12-13-12:59
 */
@Service
public class TutorServiceImpl implements TutorService {
    @Autowired
    TutorMapper tutorMapper;

    @Override
    public Tutor selectByUsername(String username) {
        return tutorMapper.selectByUsername(username);
    }

    @Override
    public void addTutor(User user) {
        tutorMapper.addTutor(user);
    }

    @Override
    public void updateTutor(User user) {
        tutorMapper.updateTutor(user);
    }

    @Override
    public void updateTutorPwd(String newPassword, String username) {
        tutorMapper.updateTutorPwd(newPassword,username);
    }

    @Override
    public ArrayList<Tutor> selectAll() {
        return tutorMapper.selectAll();
    }

    @Override
    public ArrayList<Tutor> conditionSelect(Tutor tutor) {
        return tutorMapper.conditionSelect(tutor);
    }

    @Override
    public Tutor selectByOpenid(String openid) {
        return tutorMapper.selectByOpenid(openid);
    }
}
